package org.csu.backofficemanagersys.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.csu.backofficemanagersys.domain.AdminLog;
import org.csu.backofficemanagersys.mapper.AdminLogMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminLogService {
    @Autowired
    private AdminLogMapper adminLogMapper;



    public List<AdminLog> getAllAdminLog(){
        return adminLogMapper.selectList(null);
    }
    public List<AdminLog> getAdminLogByName(String username){
        return adminLogMapper.selectList(new QueryWrapper<AdminLog>().eq("username",username));
    }
    public void insertLog(AdminLog adminLog){
        adminLogMapper.insert(adminLog);
    }
    public List<AdminLog> findAdminLogLike(String key){
        return adminLogMapper.selectList(new QueryWrapper<AdminLog>().like("username",key));
    }
}
